//
//  CoachCell.m
//  KiklinkApp
//
//  Created by LJC on 14-10-8.
//  Copyright (c) 2014年 Kiklink. All rights reserved.
//

#import "CoachCell.h"
#import "UIImageView+WebCache.h"

@implementation CoachCell

- (void)awakeFromNib
{
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
}

- (void)loadData
{
    self.nameLabel.text = @"孙曼今";
    self.photo.image = [UIImage imageNamed:@"placeHolder.png"];
    self.descriptionLabel.text = @"啊飒飒和会的发生的违规外科二姐夫的的骄傲是开发撒飒飒打开撒的卡是否噶飒飒大师的撒的阿萨达是啊飒飒和会的发生的违规外科二姐夫的的骄傲是开发撒飒飒打开撒的卡是否噶飒飒大师的撒的阿萨达是";
}

- (void)loadDataWithCoach:(Coach *)coach
{
    self.nameLabel.text = coach.name;
    self.descriptionLabel.text = coach.profile;
    
    self.photo.clipsToBounds = YES;
    [self.photo sd_setImageWithURL:[NSURL URLWithString:[Base_Url stringByAppendingString:coach.photo]] placeholderImage:[UIImage imageNamed:@"placeHolder.png"]];
}

+ (CGFloat)cellHeight:(Coach *)coach
{
    NSDictionary * attributedDic = [NSDictionary dictionaryWithObjectsAndKeys:[UIFont systemFontOfSize:13.0], NSFontAttributeName, nil];
    CGRect newDescriptionRect = [coach.profile boundingRectWithSize:CGSizeMake(ScreenWidth-30, 20000) options:NSStringDrawingUsesLineFragmentOrigin attributes:attributedDic context:nil];
    
    return newDescriptionRect.size.height + 240;
}

@end
